package zhang.lao.service.console;/**
 * Created by zhangqin on 2017/8/29.
 */

import org.springframework.stereotype.Service;
import zhang.lao.build.tool.RotateImage;
import zhang.lao.pojo.console.resp.HttpResult;

import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.OutputStream;

/**
 * 自动驾驶监控
 * @author
 * @create 2017-08-29 9:28
 **/


@Service
public class MachineMonitoringService {

    /**
     * 获取图片
     * @param path
     * @param degree
     * @param outputStream
     * @throws IOException
     */
    public void getMonitoringImage(String path , int degree, OutputStream outputStream) throws IOException {
        BufferedImage bufferedImage= ImageIO.read(new FileInputStream(path));
        ImageIO.write(RotateImage.rotateImage(bufferedImage,degree),"png",outputStream);
    }


}
